package com.hdax.dmw.scheduler.controller;

import com.hdax.dmw.entity.scheduler.SchedulerSeat;
import com.hdax.dmw.scheduler.service.SchedulerSeatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping(path = "scheduler/seat")
public class SchedulerSeatController {

    @Autowired
    private SchedulerSeatService seatService;

    @PostMapping(path = "/detail")
    public SchedulerSeat detail(
            @RequestParam("scheduleId")Long scheduleId,
            @RequestParam("x")Integer x,
            @RequestParam("y")Integer y
    ){
        return seatService.detail(scheduleId,x,y);
    }

    @PostMapping(path = "/updates")
    public void batchUpdate(@RequestBody List<SchedulerSeat> schedulerSeats){
        seatService.updateBatchById(schedulerSeats);
    }
}
